package com.wonders.module.base.dao.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.wonders.common.constant.CommonConstant;
import com.wonders.framework.dao.impl.BaseDaoImpl;
import com.wonders.module.base.dao.DicDao;
import com.wonders.module.base.entity.bo.Dic;

/**
 * 数据字典数据层实现
 * 
 * @author WuBin
 * 
 */
@Repository
public class DicDaoImpl extends BaseDaoImpl implements DicDao {

	public List<Dic> getDicList() {
		Criteria criteria = super.getCurrentSession().createCriteria(Dic.class);
		criteria.add(Restrictions.eq("enable", CommonConstant.Status.ENABLED));
		criteria.addOrder(Order.asc("type"));
		criteria.addOrder(Order.asc("sort"));
		return super.listByCriteria(criteria, Dic.class);
	}

}
